home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
Tutorial
/
Cookbook
/
06a.Gauge
/
MyView.m
< prev
next >
Wrap
Text File
|
1995-06-12
|
720b
|
38 lines
/* Generated by Interface Builder */
#import "MyView.h"
#import <dpsclient/wraps.h>
#import <appkit/Control.h>
#define ARROW_LENGTH 20.0
@implementation MyView
- mySlider:sender
{
myFloat = [sender floatValue];
[self display];
return self;
}
- drawSelf:(NXRect*)r :(int)c
{
NXEraseRect(&bounds);
PSsetgray(NX_BLACK);
PSsetlinewidth(10.0);
PStranslate(bounds.size.width*0.5, bounds.size.height*0.1);
PSrotate(-myFloat);
PSnewpath();
PSmoveto(0.0, 0.0);
PSlineto(0.0, bounds.size.height*0.7);
PSrmoveto(-ARROW_LENGTH, -ARROW_LENGTH);
PSrlineto(ARROW_LENGTH, ARROW_LENGTH);
PSrlineto(ARROW_LENGTH, -ARROW_LENGTH);
PSstroke();
return self;
}
@end